<?php
namespace Home\Controller;
use Think\Controller;

/**
 * Class 环信通信
 * @package Home\Controller
 */
class EmchatController extends Controller {
	
	public function obj(){
        Vendor('emchat.Easemob#class');
        $options['client_id']='YXA6-vlIMCZXEeaGxMf-qxfQ8Q';
        $options['client_secret']='YXA6fPS2Icmqlhi6cwm0-9x0nG_cVa4';
        $options['org_name']='prny';
        $options['app_name']='listen';
        $h = new \Easemob($options);
        return $h;
    }

    /**
     * 注册用户
     */
    public function emchat_createUser($member_name,$member_pass){
        $h = $this->obj();
        $user = $h->createUser($member_name,$member_pass);
        return $user;
    }

    /**
     * 获取token
     */
    public function emchat_getToken(){
        $h = $this->obj();
        $token = $h->getToken();
        return $token;
    }

    /**
     * 获取单个用户
     */
    public function emchat_getUser($member_name){
        $h = $this->obj();
        $user = $h->getUser($member_name);
        return $user;
    }

    /**
     * 重置密码
     */
    public function emchat_resetPassword($member_name,$pass){
        $h = $this->obj();
        $pass = $h->resetPassword($member_name,$pass);
        return $pass;
    }

    /**
     *
     */









}